<?php
    session_start();
    session_unset();
    $msg='';
    if(isset($_REQUEST['status']))
    {
        if($_REQUEST['status']=='FAILED')
            $msg='Los datos de acceso son incorretos.';
        if($_REQUEST['status']=='EXP')
            $msg='No has ingresado correctamente.';
        if($_REQUEST['status']=='CFAILED')
            $msg='Error con la base de datos.';
    }
?>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Dash HR login</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="bootstrap/css/bootstrap.css" rel="stylesheet">
    <style>
        body {
          padding-top: 40px;
          padding-bottom: 40px;
          background-color: #eee;
        }

        .form-signin {
          max-width: 330px;
          padding: 15px;
          margin: 0 auto;
        }
        .form-signin .form-signin-heading,
        .form-signin .checkbox {
          margin-bottom: 10px;
        }
        .form-signin .checkbox {
          font-weight: normal;
        }
        .form-signin .form-control {
          position: relative;
          font-size: 16px;
          height: auto;
          padding: 10px;
          -webkit-box-sizing: border-box;
             -moz-box-sizing: border-box;
                  box-sizing: border-box;
        }
        .form-signin .form-control:focus {
          z-index: 2;
        }
        .form-signin input[type="text"] {
          margin-bottom: -1px;
          border-bottom-left-radius: 0;
          border-bottom-right-radius: 0;
        }
        .form-signin input[type="password"] {
          margin-bottom: 10px;
          border-top-left-radius: 0;
          border-top-right-radius: 0;
        }
    </style>
  </head>        
  <body>
    <div class="container">
      <form class="form-signin" id="login" method="post" action="do_login.php">
        <h2 class="form-signin-heading">Ingrese sus datos de acceso</h2>
        <input name="user"   type="text"     class="form-control" placeholder="Usuario"/>
        <input name="passwd" type="password" class="form-control" placeholder="Contraseña"/>
        <label class="checkbox">
          <input type="checkbox" value="remember-me"> Recordar datos
        </label>
        <button class="btn btn-lg btn-primary btn-block" type="submit">Ingresar</button>
      </form>
    <?php
        if($msg != '')
        {
            echo '<div id="message" class="alert alert-danger">'.$msg.'</div>';
        }
    ?>
    </div> <!-- /container -->
  </body>
</html>
